/* ***********************
 * Version: MPL 1.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is Globals.js module.
 *
 * The Initial Developer of the Original Code is Rob Gerns.
 *
 * Portions created by the Initial Developer are Copyright (C) 2010
 * the Initial Developer. All Rights Reserved.
 *
 **************************/


/*************************************************
* Function Name: N/A
* 
* Purpose:
* Define all global variables for use across multiple 
* functions. 
**************************************************/

/****************************
* Function(s) using following variables:
* oisterBake(), getHttpObject(), handleResponse()
* 
* Function(s) are in file(s):
* OisterBake.js, GetHttpObject.js, HandleResponse.js
*****************************/

//the URL of the oister XML file 
var theoisterfile;
//used to store the XML http request
var xmlObject;
//used to call the function that initiates the XML http request
var http;

var xmlDoc;

/****************************
* Function(s) using following variables:
* handleResponse()
* 
* Function(s) are in file(s):
* HandleResponse.js
*****************************/

var valid;

/*****************************
* Function(s) using following variables:
* createSkeleton()
* 
* Function(s) are in file(s): 
* createSkelton.js
******************************/

//overall div that "contains" everything else, useful for CSS
var divContainer;
var divContainerId;

//used for creating a layer that's used for placement of the sitename and sitelink
var divBegin;
var divBeginId;

//used for creating a layer for the first ad
var divAd;
var divAdId;

//used for creating a layer for the sedcond ad
var divAd2;
var divAd2Id;

//used for creating a layer for the third ad
var divAd3;
var divAd3Id;

//layer for features with priority level of highest
var divHighest;
var divHigh;

//layer for features with priority level of high
var divHigh;
var divHighId;

//layer for features with priority level of normal
var divNormal;
var divNormalId;

//layer for features with priority level of low
var divLow;
var divLowId;

//layer for features with priority level of lowest
var divLowest;
var divLowestId;

//layer so that document.getElementById(whatever).insertBefore has something to insert before when sorting via priority
var enddiv;
var enddivId;

/*************************************/


/*************************************
* Function(s) using following variables:
* siteName_Link()
* 
* Function(s) are in file(s):
* SiteName.js
*************************************/
//used to store the value of the "sitelink" element that's defined in the Oister XML file
var sitelink;

//used to store the value of the "sitename" element that's defined in the Oister XML file
var sitename;

/************************************/

/*************************************
* Function(s) using following variables:
* briefShowUntil()
* 
* Function(s) are in file(s):
* BriefShowUntil.js
*************************************/
//used in regex to remove any timezone indications found in the Oister XML file's "<brief><showuntil>" element
var replaceTimeZone;

//used in regex to reformat (RFMT) the showuntil datetime into a numeric string
var xmlShowUntilDateRFMT;

/************************************/

/*************************************
* Function(s) using following variables:
* siteTagline()
* 
* Function(s) are in file(s):
* SiteTagline.js
*************************************/
var tagline;
/************************************/

/*************************************
* Function(s) using following variables:
* getFeatures()
* 
* Function(s) are in file(s):
* WriteFeatures.js
*************************************/
var currentFeature; //the feature element in the Oister XML file that's currently being parsed
var currentFeaturePriority; //feature's defined priority level
var currentFeatureHidePriority; //feature's "hidepriority" attribute value
var featureTitle; //feature's title
var featureDesc; //feature's description
var featureContact; //feature's contact info
var featureLink; //feautere's URL
var featureTags; //feature's defined tags
var featureMap; //feature's defined map URL
var featureAuthor; //feature's author
var featureAuthorEmail; //feature's author's e-mail address
var featureContributors; //feature's contributors
var featureCopyright; //feature's copyright info
var featureDocumentation; //feature's documentation info 
var featureGUID; //feature's GUID
var featureTimestamp; //feature's timestamp (creation datetime)
var featureShowUntil; //feature's showuntil datetime
var featureImages; //used to read feature's images, if any
var featureImageNum0; //feature's first image
var featureImageLink0; //feature's first image source
var featureImageCaption0; //feature's first image caption (usually used as alt text)
var featureImageNum1; //feature's second image
var featureImageLink1; //feature's second image source
var featureImageCaption1; //feature's second image caption
var featureImageNum2; //feature's third image
var featureImageLink2; //feature's third image source
var featureImageCaption2; //feature's third image caption
var featureMedia; //used to determine whether feature has any media defined
var featureMediaType; //type of media (e.g. "mpeg/audio")
var featureMediaFilesize; //size of media file in bytes
var featureMediaLink; //URI to media file
/****************************/

/*************************************
* Function(s) using following variables:
* writeFeatureSetup()
* 
* Function(s) found in file(s):
* WriteFeatures.js
*************************************/

//used to manipulate the DOM later and create layers to hold the feature info
var divFeature;

//used to give an element ID to the feature's DOM node when it's created
var divFeatureId; 

/*************************************
* Function(s) using following variables:
* writeFeature()
* 
* Function(s) found in file(s):
* WriteFeatures.js
*************************************/

//all of these are used to create the individual HTML div layers to contain the relevant info
var divFeatureTitle;
var divFeatureDesc;
var divFeatureImage = new Array();
var divFeatureContact;
var divFeatureLink;
var divFeatureTags;
var divFeatureMap;
var divFeatureAuthor;
var divFeatureAuthorEmail;
var divFeatureContributors;
var divFeatureDocumentation;
var divFeatureDocumentation;
var divFeatureGUID;
var divFeatureTimestamp;
var divFeatureShowUntil;
var divFeatureMedia;
var featureIdNum;
var priorityID;

/*************************************
* Function(s) using following variables:
* writeAuthorsEmail()
* 
* Function(s) found in file(s):
* SiteAuthorsEmail.js
*************************************/

//Used to create a node in the DOM that will contain any site author's e-mail that was defined
var divAuthorsEmail; 

//Used to give the node an ID
var authorsEmailId; 

/*************************************
* Function(s) using following variables:
* writeAuthors()
* 
* Function(s) found in file(s):
* SiteAuthors.js
*************************************/

//Used to create a node in the DOM to contain the site author(s) info
var divAuthors; 

//Used to give the node an ID
var authorsId;  

/*************************************
* Function(s) using following variables:
* writeCreateDate()
* 
* Function(s) found in file(s):
* SiteCreateDate.js
*************************************/

//Used to create a node in the DOM to contain the createdate info
var divCreateDate; 

//Used to give the node an ID
var createDateId;  

/*************************************
* Function(s) using following variables:
* writeLicense()
* 
* Function(s) found in file(s):
* SiteLicense.js
*************************************/

//Used to create the DOM node that will contain the license info
var divLicense; 

//Used to give the node an ID
var licenseId;  

/*************************************
* Function(s) using following variables:
* writeNotes()
* 
* Function(s) found in file(s):
* SiteNotes.js
*************************************/

//Used to create the DOM node for any notes
var divNotes;
 
//Used to give the node an ID
var notesId;  

/*************************************
* Function(s) using following variables:
* writeSponsors()
* 
* Function(s) found in file(s):
* SiteSponsors.js
*************************************/

//used to create a new DOM node to contain the current sponsor info
var divSponsor; 

//used to give the sponsor DOM node an ID
var sponsorId; 

